const router = require('koa-router')();
const CommodityPool = require('../model/CommodityPool.js');
//上传图片
router.post('/findSpuInfo', async (ctx) => {
  await new Promise((resolve, reject) => {
    CommodityPool.find({}, function (err, doc) {
      if (err) {
        reject(err);
        ctx.body = {
          code: 500,
          obj: err
        };
      } else {
        resolve();
        ctx.body = {
          code: 200,
          obj: doc
        };
      }
    })
  });
})
module.exports = router.routes();
